package com.xez.renderers
{
	import com.xez.data.DirRoot;
	
	import spark.components.LabelItemRenderer;
	
	public class DirListRenderer extends LabelItemRenderer
	{
		public function DirListRenderer()
		{
			super();
			
			height = 50;
		}
		
		override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
		{
			var web:DirRoot = data as DirRoot;
			if (web)
			{
				graphics.clear();
				
				if (web.isvip)
					graphics.beginFill(0xFF0000)
				else
					graphics.beginFill(0x0066CC);
				graphics.drawRoundRect(0, 1, unscaledWidth, unscaledHeight - 2, 10, 10);
				graphics.endFill();
				
				if (web.isnew)
				{
					graphics.beginFill(0x00FF00);
					graphics.drawEllipse(1, 2, 10, 10);
					graphics.endFill();
				}
			}
		}
		
	}
}